package com.yellow.orderservice.interceptor.feign;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author: hy
 * @create: 2024-02-24
 */
public class CustomFeignInterceptor implements RequestInterceptor {
    Logger logger = LoggerFactory.getLogger(this.getClass());
    @Override
    public void apply(RequestTemplate requestTemplate) {
        // TODO 可以拦截消费者请求，如在消费之前记录日志，或者变更请求信息，或者携带token
        requestTemplate.query("id","2");
        logger.info("feign成功拦截！");
    }
}
